import java.util.*;

public class Player
{
    private int strenght = 0;
    public Map<String,Thing> bag = new HashMap<>();
    
    public int getStrenght(){
         return this.strenght;
    }
    
    public void run(){
        strenght -= 10;
    }
    
    public void pick(Thing thing){
         bag.put(thing.getName(), thing);
    }
    public void eat(String name) {
          Thing thing = bag.get(name);
          if(thing != null) {
             strenght += thing.getEnergy();
             if(strenght > 200) {
                strenght = 200;
             }
          }
          
    }
    
    public boolean isDead() {
         return strenght <= 0;
    }
}





